package cn.gailvlun.gll.presentation.hotel.night

import android.content.Context
import cn.gailvlun.gll.R
import cn.gailvlun.gll.net.hotel.InsomniaHotel
import com.github.markzhai.recyclerview.SingleTypeAdapter


class HotelBrowseAdapter : SingleTypeAdapter<InsomniaHotel> {
    constructor(context: Context?) : super(context, R.layout.item_hotel_browse)

    fun getData(): List<InsomniaHotel> {
        return mCollection
    }

    fun changeSubscribe(item: InsomniaHotel) {
        for (i in 0 until itemCount) {
            if (mCollection[i].owner.id == item.owner.id) {
                mCollection[i].isIs_subscribe = item.isIs_subscribe
                notifyItemChanged(i)
            }
        }
    }
}